package com.zyn.inventory.management.forms;

import java.util.ArrayList;
import java.util.List;

import com.zyn.inventory.management.enums.UserRole;

public class UserForm {
	private String username;
	private String password;
	private String realName;
	private List<UserRole> userRoles = new ArrayList<UserRole>();

	public List<UserRole> getUserRoles() {
		return userRoles;
	}

	public void setUserRoles(List<UserRole> userRoles) {
		this.userRoles = userRoles;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String toString() {
		return "UserForm [username=" + username + ", password=" + password
				+ ", realName=" + realName + "]";
	}
	
	public boolean hasRole(UserRole role){
		if(userRoles.size()==0)
			return false;
		return userRoles.contains(role);
	}

}
